
using System;
using System.Text;

using NHibernate;
using NHibernate.Cfg;
using NHibernate.Criterion;
using NHibernate.Exceptions;

using LastFMGenNHibernate.EN.LastFM;
using LastFMGenNHibernate.CAD.LastFM;

namespace LastFMGenNHibernate.CEN.LastFM
{
        public partial class ArtistaCEN
        {
        public void Valorar (int p_Artista_OID, int valor)
        {
            ArtistaEN artista = _IArtistaCAD.ReadOIDDefault(p_Artista_OID);
                /*PROTECTED REGION ID(LastFM.ArtistaCEN_Valorar_precondition) START*/

                // Preconditions
                // if( !() )
                //              throw new ModelException("Method Valorar() preconditions are violated.");
             
                /*PROTECTED REGION END*/

                /*PROTECTED REGION ID(LastFM.ArtistaCEN_Valorar_body) ENABLED START*/

                // Body

            Modify(p_Artista_OID, artista.Etiqueta, artista.Nombre, valor);
               // throw new NotImplementedException ("Method Valorar() not yet implemented.");

                /*PROTECTED REGION END*/
            if (artista.Valor < 0)
            {
                throw new ModelException("No puede tener valor negativo el artista");
            }
                /*PROTECTED REGION ID(LastFM.ArtistaCEN_Valorar_postcondition) START*/

                // Postconditions
                // if( !() )
                //              throw new ModelException("Method Valorar() postconditions are violated.");

                /*PROTECTED REGION END*/
        }
        }
}
